<include file="Public/min-header" />
<div class="wrapper">
    <include file="Public/breadcrumb" />
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <nav class="navbar navbar-default">
                            <div class="collapse navbar-collapse">
                                <form class="navbar-form form-inline" action="{:U('Amuse/comment')}" method="post">
                                    <div class="form-group">
                                        <input type="text" name="keywords" class="form-control" placeholder="搜索">
                                    </div>
                                    <button type="submit" class="btn btn-primary">提交</button>
                                </form>
                            </div>
                        </nav>
                    </div>
                    <div class="box-body">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="list-table" class="table table-bordered table-striped dataTable">
                                    <thead>
                                        <tr role="row">
                                            <th>ID</th>
                                            <th>反馈者</th>
                                            <th>反馈者图片</th>
                                            <th>反馈内容</th>
                                            <th>反馈图片</th>
                                            <th>添加时间</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <foreach name="list" item="vo" key="k">
                                            <tr role="row" align="center">
                                                <td style="line-height:34px;">{$vo.id}</td>
                                                <td align="left" style="line-height:34px;">
                                                  <if condition="$vo['user_name'] neq ''">{$vo.user_name}<else />{$vo.phone}</if>
                                                </td>
                                                <td align="left" style="line-height:34px;">
                                                  <if condition="$vo['head_picture'] neq ''">
                                                    <a href="__ROOT__{$vo.head_picture}" target="_blank">
                                                      <img width="34" height="34" src="__ROOT__{$vo.head_picture}">
                                                    </a>  
                                                  </if>
                                                </td>
                                                <td align="left" style="line-height:34px;">
                                                  {$vo.contents}
                                                </td>
                                                <td align="left" style="line-height:34px;">
                                                    <if condition="$vo['images'] neq ''">
                                                        {$vo.images}
                                                    </if>
                                                </td>
                                                <td align="left" style="line-height:34px;">{$vo.add_time|date="Y-m-d H:i:s",###}</td>
                                                <td style="line-height:34px;">
                                                    <a class="btn btn-danger" onClick="delfun(this,{$vo.id})"><i class="fa fa-trash-o"></i></a>
                                                </td>
                                            </tr>
                                        </foreach>
                                    </tbody>
                                    <tfoot>
                                    </tfoot>
                                </table>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
function delfun(obj,id) {
    if (confirm('确认删除')) {
		$.post("{:U('Amuse/comment_img')}",{id:id},function(data){
			if(data.code==200){
				$(obj).parent().parent().remove();
				alert('删除成功');
			}else{
				alert('删除失败');
			}
		},'json');
    }
    return false;
}
</script>
</body>

</html>
